29. 实战演练:用代码画图

Python:彩虹 Turtle

🌈绘制彩虹

使用下面的 workspace 画一个彩虹色图形,或画你自己选择的图形!

几个可能有用的额外 turtle 方法(假设你有一个叫做 terry 的 turtle):

  • terry.hideturtle() 将使 turtle 本身消失。
  • terry.showturtle() 将使其再次出现。

正如你之前见过的:

  • terry.width(10) 将使其画出很粗的线条。
  • terry.penup() 将使其“抬笔”并且在移动时不绘制线条。
  • terry.pendown() 将使其再次移动时开始绘制图形。

别忘了先创建一个 turtle。(你并非必须叫它 terry 。)

之后不知道该怎么操作?尝试 for 循环!

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: html-live
  • Opened files (when workspace is loaded): n/a

备注 :如果你无法打开上面的workspace,请去 这里

这是一道开放式练习。你可以尝试很多或尝试很少!(尝试越多,学到的知识越多。)_

当你尝试完毕后,请观看此页面下方的视频,查看一些可行的示例。

Task Description:

在继续之前,确保你已经完成了每个步骤!

Task List:

Task Feedback:

真希望我能看到你的多彩代码!

Python:彩虹 Turtle 演示

Python:彩虹 Turtle 演示(第 2 部分)